package cn.jinjimi.app.main.activity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import cn.jinjimi.framework.helper.annotation.EventTrace;
import cn.jinjimi.app.BuildConfig;
import cn.jinjimi.app.R;
import cn.jinjimi.app.bean.EventID;
import cn.jinjimi.app.main.extend.ToolBarCommonActivity;

/**
 * Created by haner on 14-12-10.
 */
public class AboutUsActivity extends ToolBarCommonActivity {
    private ImageView imgBg;

    public static void launchMe(Context startActivity) {
        if (startActivity == null)
            return;
        Intent intent = new Intent(startActivity, AboutUsActivity.class);
        if (!(startActivity instanceof Activity)) {
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        }
        startActivity.startActivity(intent);
    }

    @Override
    protected void beforeInitView() {
        setContentView(R.layout.fragment_about_us);
    }

    @Override
    @EventTrace(EventID.APP_OWNER_SET_ABOUTUS)
    protected void initial() {
        initView();
    }

    private void initView() {
        TextView version = (TextView) findViewById(R.id.tv_version);
//        version.setText("当前版本：" + AndroidUtils.getAppVersionName(this));
        version.setText("版本 " + BuildConfig.VERSION_NAME + "  build " + BuildConfig.VERSION_CODE);
        setTitle("关于我们");

        version.setVisibility(View.VISIBLE);
        findViewById(R.id.tv_copyright).setVisibility(View.VISIBLE);

        imgBg = (ImageView) findViewById(R.id.imgBg);
    }

}
